<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var minimumMoves = function (s) {
      let t = 0    //记录一共更改了多少次
      for (let i = 0; i < s.length; i++) {
        if (s[i] === "X") {   //只要是X就更改，并且不管后面两个是不是X直接跳过
          t++
          i += 2
        }
      }
      return t
    };
    console.log(minimumMoves("XXX"));
  </script>
</body>

</html>